

#ifndef __xiong_socketlist
#define __xiong_socketlist

#include "Poco/Net/Socket.h"
#include "Poco/Mutex.h"


using Poco::Net::Socket;
using Poco::FastMutex;

class SocketList
{
public:
    SocketList()
    {}
    ~SocketList()
    {
    }

    void addSocketEvent(Socket &s)
    {
        FastMutex::ScopedLock lock(_mutex);
        socketlist.push_back(s);
    }

    void clone(std::vector<Socket> &x)
    {
        FastMutex::ScopedLock lock(_mutex);
        x.swap(socketlist);
        socketlist.clear();
    }

    void test()
    {
        std::cout << "123" << std::endl;
    }

private:
    std::vector<Socket> socketlist;
    Poco::FastMutex _mutex;
};

static SocketList socketcloselist;
static SocketList socketwritelist;









#endif

